import { defineStore } from "pinia"
import hyRequest from "@/services/request"

const useCategoryStore = defineStore("category",{
    state:() => ({
        categories:[]
    }),
    actions:{
        async fetchCategoriesAction() {
            const res = await hyRequest.get("/home/categories")
            this.categories = res.data.data
        }
    }
})

export default useCategoryStore